<template>
	<view class="p20">
		<view class="flex row-center ">
			<image src="/static/img/order/evaluate.png" class="h26 w68" mode=""></image>
			<view class="color-232323">
				写下真实服务感受，帮助千万用户决策
			</view>
			<image src="/static/img/order/evaluate.png" class="h26 w68" mode=""></image>
		</view>
		<view class="mt20 radius20 bg-fff pt24 pb36 ">
			<view class="flex ">
				<view class="w6 h20 bg-zs radius4 "></view>
				<view class="fs30 color-232323 ml20">
					陪诊师
				</view>
			</view>
			<view class="p26 flex">
				<image :src="data.avatar" class="h92 w92 radius" mode="aspectFill"></image>
				<view class="pl24">
					<view class="fs28 color-232323 fw-700">{{data.name}}</view>
					<types :list="data.types" />
					</types>
				</view>
			</view>
		</view>
		<view class="mt20 radius20 bg-fff p20">
			<view class="">
				<text class="color-999">服务类型：</text>
				<text class="color-666">{{data.service_name}}</text>
			</view>
			<view class="mt22">
				<text class="color-999 fs28">订单金额：</text>
				<text class="fs24 color-666">￥</text>
				<text class="color-666 fs28">{{data.pay_price}}</text>
			</view>

		</view>
		<view class="mt20 radius20 bg-fff p20 color-999 flex-col col-center">
			<view class="">打个分吧</view>
			<view class="mt20 flex row-around w-max">
				<view class="" v-for="(item,index) in typeList" :key="index" @click="form.c_type=item">
					<evaluate-type :type="item" :checked="form.c_type==item" />
				</view>
			</view>
			<view class="mt20">说点什么</view>
			<view class="bg-f8f p20 radius16 w-max mt20" style="border: 1rpx dashed #cfcfcf;">
				<u-input type="textarea" height="270" v-model="form.content" placeholder="请对陪诊师进行评价" :clearable="false">
				</u-input>
			</view>
		</view>
		<view class="radius12 bg-zs h84 color-fff mx40 flex row-center mt40" @click="toComment">
			提交评价
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data: '',
				star: 5,
				content: '',
				typeList: ['good', 'medium', 'bad'],
				form: {
					c_type: 'good',
					content: ''
				}
			};
		},
		onLoad() {
			this.getData()
		},
		methods: {
			toComment() {
				let params = {
					...this.$params,
					...this.form,
				}
				this.$request('/member/order/toComment', params).then(res => {
					this.$msg(res.msg)
					setTimeout(this.$navBack, 1000)
				})
			},
			getData() {
				this.$request('/member/order/orderInfo', this.$params).then(res => {
					let data = res.data
					data.type_text = this.$list('type')[data.type]
					this.data = res.data
				})
			},
		}
	}
</script>

<style lang="scss">

</style>
